<!DOCTYPE >
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title>SNTV-무료TV다시보기</title>
<meta name="author" content="TACO" />
<meta name="format-detection" content="telephone=no" />
<meta name="keywords" content="tv,kbs,mbc,replay" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=medium-dpi" />
<link rel="apple-touch-icon" href="icon@2x.png"/>
<link rel="stylesheet" href="css/mobile.css" />
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/spin.js"></script>
<script language="javascript">
<!--
	var page = 1;
	var total = 0;
	var json_url = "";
	var cnt = 0;
	var blist = true;
	var $list;
	//var id = Request('id');
	
	$(document).ready(function()
	{
 	 });
 	 
 	 
	$(window).scroll(function()
	{
		// Android more
		if($(window).scrollTop() == $(document).height() - $(window).height())
		{
			if(page > 1 && page <= total)
			{
				if(blist)
				{
					$("#load").show();
					More();
				}
			}
		}	
	});
	
	function More()
	{
		var response = "";
		var latest = "";
		
		blist = false;
		$list = $("#list");

		$.getJSON(json_url + "&start-index=" + page, function(data)
		{
			total = parseInt(data.data.totalItems);
			
			if(page <= total)
			{
				$.each(data.data.items, function(i, item) 
				{
					if(cnt == 0)
					{
						latest = '<section class="visual" style="background: url(' + item.thumbnail.hqDefault + ') center center no-repeat;">';
						latest += '<h2>' + item.title + '</h2>';
						latest += '<a href="http://www.youtube.com/playlist?list=PL' + item.id + '">링크</a>';
						latest += '</section>';
						
						$("#latest").html(latest);						
					}
					else
					{
						if(item.description == "Y")
						{
							response += "<li class='mo_none'>"
							response += '<a href="http://www.tvfree.kr">';
						}	
						else
						{
							response += '<li>';
							response += '<a href="http://www.youtube.com/playlist?list=PL' + item.id + '">';
						}

						response += item.title + '</a>';
						response += '</li>';
					}
					
					
					cnt++;					
        		});
        	}
							
			if(response == "")
				$("#loading").hide();
			else
			{
				$(response).appendTo($list);
				blist = true;
			}
				
			$("#load").hide();	
			
			page += 50;
			
			if(page > total)
				$("#loading").hide();
		});
	}
	
	function Load(id, name)
	{
		json_url = "https://gdata.youtube.com/feeds/api/users/" + id + "/playlists?v=2&alt=jsonc&max-results=50";
		
		$("#title").html(name);
		$("#load").show();
		
		More();
	}
-->
</script>
<style>
	.box{display: none}
</style>
<script>
	//popup
	$(document).ready(function(){
		$('.open').click(function(){
			$('.box').animate({opacity:'toggle'},'fast');
		})
	})
</script>
</head>
<body>
<div id="wrap">
	<header>
		<a href="index.html" class="btn back">홈으로</a>
		<h1 id="title"></h1>
	<a class="btn menutop open">menu</a>
	</header>
	<nav class="menu box" id="menu">
		<ul>
			<li><a href="entertainment.html">엔터테인먼트</a></li>
			<li><a href="drama.html">드라마</a></li>
			<li><a href="animation.html">애니메이션</a></li>
			<li><a href="documentary.html">다큐멘터리</a></li>
		</ul>
	</nav>
	<div id="latest"></div>
	<ul id="list" class="list2"></ul>
	<div id="loading">
		<div id="load" style="display:none;"></div>
	</div>
</div>

</body>
</html>
<script>
	var opts = {
	  lines: 8, // The number of lines to draw
	  length: 4, // The length of each line
	  width: 3, // The line thickness
	  radius: 6, // The radius of the inner circle
	  color: '#fff', // #rgb or #rrggbb
	  speed: 1, // Rounds per second
	  trail: 54, // Afterglow percentage
	  shadow: false // Whether to render a shadow
	};
	var target = document.getElementById('load');
	var spinner = new Spinner(opts).spin(target);
</script>